package com.ymatou.query.trading.api.testcase;

import java.util.ArrayList;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.trading.api.parameter.GetBuyerOrdersList2Bean;
import com.ymatou.query.trading.api.service.GetBuyerOrdersList2Call;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.common.enums.AppViewOrderStateEnum;
import com.ymttest.utils.constant.ECode;

/**
 * 获取买家订单列表2 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetBuyerOrdersList2 {

	private static GetBuyerOrdersList2Bean getbuyerorderslist2bean;
	private static GetBuyerOrdersList2Call getbuyerorderslist2call;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取买家订单列表2");
	}

	@Before
	public void caseUp() {

		getbuyerorderslist2bean = new GetBuyerOrdersList2Bean();
		getbuyerorderslist2call = new GetBuyerOrdersList2Call();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getbuyerorderslist2call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBuyerOrdersList2_001() {
		Logger.start(true,"获取买家订单列表2成功");
		try {
			// 参数
			getbuyerorderslist2bean.setAppViewOrderState(AppViewOrderStateEnum.PendingReceive);
			int BuyerId = 1113;
			getbuyerorderslist2bean.setBuyerId(BuyerId);
			int OrderId = 500384768;
			getbuyerorderslist2bean.setLastOrderId(OrderId);
			int OrderNum = 13;
			getbuyerorderslist2bean.setOrderNum(OrderNum);
			ArrayList<Integer> list = new ArrayList<Integer>();
			getbuyerorderslist2bean.setOrderStatusList(list);
			// 发送请求
			getbuyerorderslist2call.setData(getbuyerorderslist2bean);
			getbuyerorderslist2call.callService();
			Logger.verifyEquals(ECode.SUCCESS, getbuyerorderslist2call.getCode(), "验证Code");
			// Logger.verifyEquals(ErrorCode.SUCCESSMSG,
			// getbuyerorderslist2call.getMsg(), "验证Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}